#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    srand((unsigned int)time(nullptr));
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_accept_clicked()
{
    ui->label->setText("走起！回家喽");

}

void Widget::on_pushButton_reject_clicked()
{
//    int width = this->width();
//    int height = this->height();

//    int x = rand()%width;
//    int y = rand()%height;

//    ui->pushButton_reject->move(x,y);
}

void Widget::on_pushButton_reject_pressed()
{
    int width = this->width();
    int height = this->height();

    int x = rand()%width;
    int y = rand()%height;

    ui->pushButton_reject->move(x,y);
}
